home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness: Critical Thinking Skills / Workplace Effectiveness: Critical Thinking Skills.iso / pc / Files / Patterns.dxr / 00008_sprite handlers.ls < prev    next >
Encoding:
Text File  |  1998-09-16  |  2.1 KB  |  87 lines

  1. global gHandCursor, gHandMask, gFingerCursor, gFingerMask
  2.  
  3. on clickButton action
  4.   set spriteNum to the clickOn
  5.   set castMember to the member of sprite spriteNum
  6.   set Castname to the name of member castMember
  7.   set castNum to the castLibNum of member castMember
  8.   puppetSprite(spriteNum, 1)
  9.   repeat while the mouseDown
  10.     if rollOver(spriteNum) then
  11.       set the member of sprite spriteNum to member (Castname && "dn") of castLib castNum
  12.       updateStage()
  13.       next repeat
  14.     end if
  15.     set the member of sprite spriteNum to castMember
  16.     updateStage()
  17.   end repeat
  18.   set the member of sprite spriteNum to castMember
  19.   updateStage()
  20.   puppetSprite(spriteNum, 0)
  21.   if rollOver(spriteNum) then
  22.     do(action)
  23.   end if
  24. end
  25.  
  26. on setPuppetState channelList, type, state
  27.   if type = #c then
  28.     repeat with n = getAt(channelList, 1) to getAt(channelList, 2)
  29.       puppetSprite(n, state)
  30.     end repeat
  31.   else
  32.     repeat with n in channelList
  33.       puppetSprite(n, state)
  34.     end repeat
  35.   end if
  36. end
  37.  
  38. on setVisibleState channelList, type, state
  39.   if type = #c then
  40.     repeat with n = getAt(channelList, 1) to getAt(channelList, 2)
  41.       set the visible of sprite n to state
  42.     end repeat
  43.   else
  44.     repeat with n in channelList
  45.       set the visible of sprite n to state
  46.     end repeat
  47.   end if
  48. end
  49.  
  50. on setMoveableState channelList, type, state
  51.   if type = #c then
  52.     repeat with n = getAt(channelList, 1) to getAt(channelList, 2)
  53.       set the moveableSprite of sprite n to state
  54.     end repeat
  55.   else
  56.     repeat with n in channelList
  57.       set the moveableSprite of sprite n to state
  58.     end repeat
  59.   end if
  60. end
  61.  
  62. on setHandCursor cState, handList
  63.   case cState of
  64.     #on:
  65.       repeat with x in handList
  66.         set the cursor of sprite x to gHandCursor
  67.       end repeat
  68.     #off:
  69.       repeat with x in handList
  70.         set the cursor of sprite x to 0
  71.       end repeat
  72.   end case
  73. end
  74.  
  75. on setFingerCursor cState, fingerList
  76.   case cState of
  77.     #on:
  78.       repeat with x in fingerList
  79.         set the cursor of sprite x to gFingerCursor
  80.       end repeat
  81.     #off:
  82.       repeat with x in fingerList
  83.         set the cursor of sprite x to 0
  84.       end repeat
  85.   end case
  86. end
  87.